<%= flash[:notice] %>
<%= error_messages_for :user %>
<% form_for :user, :url => user_path(@user), :html => {:method => :put} do -%>
<p><label for="login">Login: <%= text_field :user, :login %></p>

<p><label for="name"></label>
Name: <%= text_field :user, :name %></p>

<p><label for="admin"></label>
<%= check_box :user, :admin %> Admin?</p>
<p><label for="groups">Groups:</label></p>
<p>
  <% for group in @groups%>
    <input type="checkbox"
        id="<%= group.id%>"
	name="groups[]"
	value="<%= group.id%>"
	<%if @user.groups.include? group%> checked="checked"<%end%>
    > <%= group.name %>
  <% end if @groups%>
</p>

<p><%= submit_tag 'Done' %></p>
<% end -%>

